package com.example.runnable;

import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;

public class MainActivity extends Activity {
	Button mLoadButton;
	ImageView mImageframe;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		mImageframe = (ImageView) findViewById(R.id.image_frame);
		
		mLoadButton = (Button) findViewById(R.id.load_image_button);
		mLoadButton.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View v) {
				long startTime = System.currentTimeMillis();
				
				mImageframe.setImageResource(R.drawable.space);
				
				long time = System.currentTimeMillis()
										- startTime;
				
				Log.d("MainActivity","Time to load: "
							+ time + " milliseconds");
			}
		});
	}

}
